<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input class="one" type="text">
    <button class="but">点击查看是否需要带伞</button>
    
    <script>
        var one1=document.getElementsByClassName("one")[0];
        var but=document.getElementsByClassName("but")[0];
        but.onclick=function(){
            var box=one1.value;
            var good =box=="下雪了"?'需要打伞伞呢':'雪雪不大不需要捏';
            alert(good);
        }
    </script>
</body>
</html>